package com.itheima.controller;

import com.itheima.common.entity.PageResult;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.common.entity.Result;
import com.itheima.pojo.dto.OrderDTO;
import com.itheima.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/findPage")
    public PageResult findPageOrder(@RequestBody QueryPageBean queryPageBean){
        PageResult pageResult=orderService.findPageOrder(queryPageBean);
        return pageResult;
    }

    @PostMapping("/update")
    public Result updateOrder(@RequestBody OrderDTO orderDTO){
        orderService.updateOrder(orderDTO);
        return new Result(true,"修改预约状态成功");
    }

}
